#ifndef Keyboard_H
#define Keyboard_H

#include <QMainWindow>
#include "gui.h"

class KTV;
class Query;

namespace Ui {
    class Keyboard;
}

class Keyboard : public QMainWindow
{
    Q_OBJECT
public:
    Keyboard(KTV *k, QWidget *parent = 0);
    ~Keyboard();
    void moveLeft();
    void moveRight();
    void moveUp();
    void moveDown();
    void keyPressEvent(QKeyEvent *);
    QString getCurrentLetter();
    void parseLetter(QString letter);
    void setText(QString t) { name = t; }
    // GUI
    void up() { moveUp(); }
    void down(){ moveDown(); }
    void left() { moveLeft(); }
    void right() { moveRight(); }
    void select();
protected:
    int beginX;
    int beginY;
    void changeEvent(QEvent *e);
    void paintEvent(QPaintEvent *);
public:
    int currentPos;
    QPixmap *keyboard;
    QPixmap *frame;
    QPixmap *doubleFrame;
    QString name;
    Query * query;
private:
    Ui::Keyboard *ui;
    QString tables[30];
    KTV *ktv;
};

#endif // Keyboard_H
